﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WebQQ2.DLL;

namespace QunRobot
{
    public partial class VerifyCodeForm : Form
    {
        private WebQQCommon com;

        public VerifyCodeForm(WebQQCommon com)
        {
            InitializeComponent();
            this.com = com;
        }

        private void VerifyCodeForm_Load(object sender, EventArgs e)
        {
            System.IO.Stream stream = com.getVerifyCodePicStream();
            if (stream != null)
                pictureBox1.Image = Image.FromStream(stream);
        }

        private void txtVerify_KeyUp(object sender, KeyEventArgs e)
        {
            if(txtVerify.Text.Length>=5||e.KeyData== Keys.Enter)
            {
                com.user.VerifyCode = txtVerify.Text;
                this.Close();
            }
        }
    }
}
